#define _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
#include<string.h>
char a[40200];
char b[201];
int main()
{
    scanf("%s", b);
    strcat(a, b);
    int n = strlen(b);
    for (int i = 0; i < n - 1; i++)
    {
        scanf("%s", b);
        strcat(a, b);
    }
    int count = 0;
    printf("%d", n);
    char num = '0';
    for (int i = 0; i <= strlen(a); i++)
    {
        if (num == a[i])
        {
            count++;
        }
        else
        {
            num = a[i];
            printf(" %d", count);
            count = 1;
        }
    }
    return 0;
}